qui(function(require, exports, module) {

    Sginal.Config = $.extend({}, Ancestor.Config, {

        SGINAL_TYPE: ['udp', 'udi'],
        SGINAL_STATUS: ['未开启','开启', '停止'],
        SERVER_TYPE: ['收录', '编码', '分甘', '中继', '目的地'],
        PageBean: null,

        validator: {
            messages: {
                name: {
                    required: "频道名称不能为空",
                },
                accessServerIp: {
                    required: '信号接入服务器IP不能为空',
                },
                port: {
                    required: '信号传输统一端口不能为空',
                },
                inputType_2: {
                    required: '分甘输入类型不能为空',
                },
                inputIp_2: {
                    required: '分甘输入IP不能为空',
                },
                outputType_2: {
                    required: '分甘输出类型不能为空',
                },
                outputIp_2: {
                    required: '分甘输出IP不能为空',
                },
                outputType_4: {
                    required: '目的地类型不能为空',
                },
                outputIp_4: {
                    required: '目的地IP不能为空',
                }
            },

            rules: {
                name: {
                    required: true,
                },
                accessServerIp: {
                    required: true,
                },
                port: {
                    required: true,
                },
                inputType_2: {
                    required: true,
                },
                inputIp_2: {
                    required: true,
                },
                outputType_2: {
                    required: true,
                },
                outputIp_2: {
                    required: true,
                },
                outputType_4: {
                    required: true,
                },
                outputIp_4: {
                    required: true,
                }
            }
        },

			TABLE_COLMODEL_CONFIG: {
				'name': {
					name: 'name',
					title: false,
					index: 'name',
					align:'center',
					sortable: false,
					width: 100
				},
				'fgIp': {
                    name: 'fpIp',
                    title: false,
                    index: 'fpIp',
                    align:'center',
                    sortable: false,
                    width: 80
                },
                'fgPort': {
                    name: 'fgPort',
                    title: false,
                    index: 'fgPort',
                    align:'center',
                    sortable: false,
                    width: 100
                },
                'fgInputType': {
                    name: 'fgInputType',
                    title: false,
                    index: 'fgInputType',
                    align:'center',
                    sortable: false,
                    width: 100,
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.sginalType(v,r);
                    }
                },
				'fgInputSrc': {
					name: 'fgInputSrc',
					title: false,
					index: 'fgInputSrc',
					align:'center',
					width: 100,
					sortable: false
				},
				'fgOutputType': {
					name: 'fgOutputType',
					title: false,
					index: 'fgOutputType',
					align:'center',
					sortable: false,
					width: 100,
					align: 'center',
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.sginalType(v,r);
                    }
				},
				'fgOutputSrc': {
					name: 'fgOutputSrc',
					title: false,
					index: 'fgOutputSrc',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'fgStatus': {
					name: 'fgStatus',
					title: false,
					index: 'fgStatus',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center',
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.sginalStatus(v,r);
                    }
				},
				'fgStatusArgs': {
					name: 'fgStatusArgs',
					title: false,
					index: 'fgStatusArgs',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'idcIp': {
					name: 'idcIp',
					title: false,
					index: 'idcIp',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'idcPort': {
					name: 'idcPort',
					title: false,
					index: 'idcPort',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'idcOutputType': {
					name: 'idcOutputType',
					title: false,
					index: 'idcOutputType',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center',
                   formatter: function(v, o, r) {
                       return Sginal.Util.formatter.sginalType(v,r);
                   }
				},
				'idcOutputSrc': {
					name: 'idcOutputSrc',
					title: false,
					index: 'idcOutputSrc',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'idcStatus': {
					name: 'idcStatus',
					title: false,
					index: 'idcStatus',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center',
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.sginalStatus(v,r);
                    }
				},
				'idcStatusArgs': {
					name: 'idcStatusArgs',
					title: false,
					index: 'idcStatusArgs',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'author': {
					name: 'author',
					title: false,
					index: 'author',
					align:'center',
					width: 100,
					sortable: false,
					align: 'center'
				},
				'operate': {
                    name: 'operate',
                    title: false,
                    index: 'operate',
                    width: 160,
                    align:'center',
                    sortable: false,
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.operate(v,r);
                    }
                },
///
                'serverIp': {
                    name: 'serverIp',
                    title: false,
                    index: 'serverIp',
                    align:'center',
                    width: 50,
                    sortable: false,
                    align: 'center'
                },
                'statusArgs': {
                    name: 'statusArgs',
                    title: false,
                    index: 'statusArgs',
                    align:'center',
                    width: 300,
                    sortable: false,
                    align: 'center'
                },
                'addTime': {
                    name: 'addTime',
                    title: false,
                    index: 'addTime',
                    align:'center',
                    width: 100,
                    sortable: false,
                    align: 'center',
                    formatter: function(v, o, r) {
                        return Sginal.Util.formatter.time(v,r);
                    }
                },
                'user': {
                    name: 'user',
                    title: false,
                    index: 'user',
                    align:'center',
                    width: 60,
                    sortable: false,
                    align: 'center'
                },
                'action': {
                    name: 'action',
                    title: false,
                    index: 'action',
                    align:'center',
                    width: 60,
                    sortable: false,
                    align: 'center'
                },
                'descr': {
                    name: 'descr',
                    title: false,
                    index: 'descr',
                    align:'center',
                    width: 300,
                    sortable: false,
                    align: 'center'
                }

			},

			TABLE: {
			    url: "/api/sginal/list",
			    rowNum: 10,
                pager: "#SginalListPager",
			    multiselect: false,
			    prmNames: {
                    page: "pageNo",
                    rows: "pageSize"
                },

			    loadBeforeSend:function(xhr, settings){
                    var auth = Ancestor.Util.getAuth(Ancestor.Config.EPG_AUTH.list);
                    xhr.setRequestHeader('Sign',auth.sign);
                    xhr.setRequestHeader("Time",auth.clientTime);
                    xhr.setRequestHeader("From",auth.from);
                    return true;
                },

			    //datatype: "local",
			    loadtext: '加载中...',
                loadui: "block",
                mtype: "post",

				colNames: ["信号名称", "分甘点IP", "分甘点端口", "分甘点输入类型", "分甘点输入地址 ", "分甘点输出类型", "分甘点输出地址", "分甘点状态", "分甘点数据", "IDC服务器IP", "IDC服务器端口", "IDC输出类型", "IDC输出地址", "IDC状态", "IDC数据", "操作人", "操作", "详情"],
				colModel: ['name', 'fgIp', 'fgPort', 'fgInputType', 'fgInputSrc', 'fgOutputType', 'fgOutputSrc', 'fgStatus', 'fgStatusArgs', 'idcIp', 'idcPort', 'idcOutputType', 'idcOutputSrc', 'idcStatus', 'idcStatusArgs', 'author', 'operate', 'details']
			},
            TABLE_STATUS_COLMODEL_CONFIG: {
                'fatherId': {
                    name: 'fatherId',
                    title: false,
                    index: 'fatherId',
                    align:'center',
                    sortable: false,
                    width: 120
                },
                'name': {
                    name: 'name',
                    title: false,
                    index: 'name',
                    align:'center',
                    sortable: false,
                    width: 120
                },
                'serverIp': {
                    name: 'serverIp',
                    title: false,
                    index: 'serverIp',
                    align:'center',
                    sortable: false,
                    width: 120
                },
                'statusArgs': {
                    name: 'statusArgs',
                    title: false,
                    index: 'statusArgs',
                    align:'left',
                    sortable: false,
                    width: 1200
                },
                'addTime': {
                    name: 'addTime',
                    title: false,
                    index: 'addTime',
                    align:'center',
                    sortable: false,
                    width: 150
                }
            },

            TABLE_STATUS: {
                url: "/api/sginal/status/list",
                rowNum: 20,
                pager: "#status_pager",
                multiselect: false,
                prmNames: {
                    page: "pageNo",
                    rows: "pageSize"
                },

                loadBeforeSend:function(xhr, settings){
                    var auth = Ancestor.Util.getAuth("/sginal/status/list");
                    xhr.setRequestHeader('Sign',auth.sign);
                    xhr.setRequestHeader("Time",auth.clientTime);
                    xhr.setRequestHeader("From",auth.from);
                    return true;
                },

                //datatype: "local",
                loadtext: '加载中...',
                loadui: "block",
                mtype: "post",

                colNames: ["频道ID","频道名称","服务器IP", "投递状态", "添加时间"],
                colModel: ['fatherId','name','serverIp', 'statusArgs', 'addTime']
            },

            TABLE_LOG: {
                url: "/api/sginal/log",
                rowNum: 10,
                pager: "#log_pager",
                multiselect: false,
                prmNames: {
                    page: "pageNo",
                    rows: "pageSize"
                },

                loadBeforeSend:function(xhr, settings){
                    var auth = Ancestor.Util.getAuth("/sginal/log");
                    xhr.setRequestHeader('Sign',auth.sign);
                    xhr.setRequestHeader("Time",auth.clientTime);
                    xhr.setRequestHeader("From",auth.from);
                    return true;
                },

                //datatype: "local",
                loadtext: '加载中...',
                loadui: "block",
                mtype: "post",

                colNames: ["操作时间", "人员", "动作", "备注"],
                colModel: ['addTime', 'user', 'action', 'descr']
            },
		});
});